<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    水仙花数 a^3+b^3+c^3=abc,判断输入的3位整数是否为水仙花数。<br>
    <script>
        var num = prompt('请输入一个三位数的整数：');//153
            //获取整数的每一个位数
        var a = num[0];
        var b = num[1];
        var c = num[2];
        if( num == a * a * a + b * b * b + c * c* c){
                document.write(num+'是水仙花数');
        }else{
                document.write(num+'不是水仙花数');
        }
    </script>
</body>
</html>